<!--
 * @Description: 
 * @Author: ljl
 * @Date: 2024-11-13 19:53:47
 * @LastEditors: rendc
 * @LastEditTime: 2024-11-14 10:17:05
-->

<template>
  <div class="bg">
    <!-- 注册组件 -->
    <Register v-if="flag" />
    <!-- 登录 -->
    <Login v-if="!flag" />
    <button @click="changeFlag">{{ flag ? '去登陆':'去注册' }}</button>
  </div>
</template>

<script setup>
import {ref} from 'vue';
// 导入自定义组件
import Login from '@/views/Login.vue';
import Register from '@/views/Register.vue';
// flag为true 显示注册页面
// flag为false 显示登录页面
const flag = ref(true);
// 
function changeFlag() {
  flag.value = !flag.value;
}
</script>
<style scoped>
.bg{
  background-image: url("@/img/image.png");
  width: 100%;
  height: 100%;
  padding: 150px 50px;
}
</style>
